# Maintainer: Balló György <ballogyor+arch at gmail dot com>

pkgname=almanah
pkgver=0.12.3
pkgrel=5
pkgdesc='Small GTK application to allow you to keep a diary of your life'
arch=('loong64' 'x86_64')
url='https://wiki.gnome.org/Apps/Almanah_Diary'
license=('GPL3')
depends=('evolution-data-server' 'libcryptui' 'gtkspell3' 'gtksourceview3')
makedepends=('appstream-glib' 'meson')
source=("https://download.gnome.org/sources/$pkgname/${pkgver%.*}/$pkgname-$pkgver.tar.xz"
         https://gitlab.gnome.org/GNOME/almanah/-/commit/8c42a676.patch)
sha256sums=('94ca4340ec651a58cfeba00f478f5a3db4d99dfac66a46d0d99705be688f305a'
            'db268e25c626ece9a097e03debb3d6b302c42b6c089cb673d6c9ed459036bd09')

prepare() {
  cd $pkgname-$pkgver
  patch -p1 < ../8c42a676.patch # Fix build with recent meson
}

build() {
  arch-meson $pkgname-$pkgver build
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  DESTDIR="$pkgdir" meson install -C build
}
